import 'package:json_annotation/json_annotation.dart';

part 'account.g.dart';

@JsonSerializable()
class Account {
  final int id;
  final String accountType;
  final String accountTypeName;
  final String balance;
  final String notArrivedBalance;
  final String withdrawCash;
  final bool payPassword;
  final bool allowWithdraw; // 是否允许提现，为true时，withdrawCash才有效。
  final bool existNotArrived; // 是否存在未到账金额的情况，为true时，notArrivedBalance才有效。
  final bool needPassword;
  final String accountTypeTag;

  Account(
    this.id,
    this.accountType,
    this.accountTypeName,
    this.balance,
    this.notArrivedBalance,
    this.withdrawCash,
    this.payPassword,
    this.allowWithdraw,
    this.existNotArrived,
    this.needPassword,
    this.accountTypeTag,
  );

  factory Account.fromJson(Map<String, dynamic> json) => _$AccountFromJson(json);

  Map<String, dynamic> toJson() => _$AccountToJson(this);
}
